Repository navigation
pkgs/id: split dependency compilation out of the Nix build with crane (#8574) - #12863
Merged
Merged
Conversation
…#8574) Convert pkgs/id/default.nix from a single buildRustPackage to the crane two-tier shape proven by atlas-search (#8560) and fleet (#8572): buildDepsOnly compiles the registry + vendored dependencies as their own derivation (id-deps), keyed only on the manifests and Cargo.lock with the workspace sources stubbed, and buildPackage builds the workspace against those artifacts from the full source tree. A one-line source change now rebuilds only the package derivation (dry-run verified: only the id-0.1.0 package derivation is listed; the id-deps derivation is untouched). Notes: - Callers may pass craneLib; standalone nix-build constructs one from the pinned crane rev the repo flakes already carry (01bc1d404a51a0a07e9d8759cd50a7903e218c82). - Crane takes the lockfile as a path and outputHashes as a separate argument, keyed by the lockfile's full git source string instead of crate name-version (same p2panda checkout, same hash). - The standalone check derivation (~line 82) is unchanged byte for byte and still instantiates; the package-root build.rs is stubbed by crane in the deps tier and runs for real in the package tier, whose source is the full tree exactly as the monolith saw it. - Tests run under the release profile in the crane path (crane reuses the dependency artifacts for the check phase) instead of the monolith's ci-check checkType. Timings on the reference laptop (both builds red only on the pre-existing #12772 failure, with an identical failure set - id-cli 743 passed / 1 failed): monolith baseline 45m16s; first crane build 94m40s (the deps tier's build+check+test passes and release-profile test compilation, under heavy concurrent load). The split's payoff is in rebuilds: the deps derivation is untouched by source changes.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8574. Follow-up to #8392; pattern proven by #8560 (atlas-search) and #8572 (fleet).
What changed
pkgs/id/default.nix: the singlebuildRustPackagebecomes the crane two-tier shape.craneLib.buildDepsOnly→ theid-depsderivation): a fileset ofCargo.toml,Cargo.lock,crates/,src/,vendor/,build.rs,.cargo/— crane stubs the workspace members' Rust targets in this tier, so it is keyed only on what can change dependency compilation. Vendored path deps compile for real here.craneLib.buildPackage):src = ./.— the full tree, exactly what the monolith saw (tests readtest-data/, the rootbuild.rschecksweb/dist). Same features (sandbox,world), samedoCheck, same postCheck fmt + clippy.craneLib ? nullargument like the reference PRs; since this file's only in-repo use is standalonenix-build, a null argument constructs craneLib from the pinned crane rev the repo flakes already carry (01bc1d404a51a0a07e9d8759cd50a7903e218c82) so the split is live on the documented path.outputHashesis a separate argument keyed by the lockfile's full git source string (same p2panda checkout hash as the monolith'sp2panda-core-0.7.1entry).id-check-0.1.0.drv).ci-checkcheckType.Evidence
/nix/store/wmij8f8panyay1i9bfmp5npb5x2ffsgr-id-deps-0.1.0), a one-line change tocrates/id-core/src/lib.rsmakesnix-build -A default --dry-runlist only the package derivation (id-0.1.0.drv) — theid-depsderivation is untouched.cli::tests::test_command_lists_cover_all_clap_subcommands("README CLI Commands table omitswalk", id-cli 743 passed / 1 failed), filed separately as id-cli test failing on main: README CLI Commands table omitswalk#12772. All other suites green in both. This PR neither fixes nor worsens it; once id-cli test failing on main: README CLI Commands table omitswalk#12772 lands, this build goes green with no further change.nixfmt --checkclean on the file.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.